package com.bbh.plugin.single.privilege.core.repository;

import com.bbh.common.domain.Menu;
import com.bbh.plugin.single.privilege.core.vo.tree.ResourceVo;
import com.bbh.plugin.single.privilege.core.vo.tree.ZTreeNoneAjaxVo;
import com.bbh.plugin.single.privilege.core.entity.Resource;
import org.springframework.boot.config.mybatis.MyBatisRepository;

import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

@MyBatisRepository
public interface ResourceMapper extends Mapper<Resource> {
    /**
     * 通过角色Id查询资源列表
     */
    List<Resource> findResourceListByRoleId(Map<String, Object> params);

    /**
     * 通过登录用户查询菜单
     *
     * @param params
     * @return
     */
    List<Menu<Menu>> findMenuListByLoginName(Map<String, Object> params);

    /**
     * 子节点查询
     * @param params
     * @return
     */
    List<ResourceVo> findChildren(Map<String, Object> params);



    /*
   * 递归查询
   * */
    List<ZTreeNoneAjaxVo> selectTreeResource(Map<String, Object> params);
}